import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.String;

public class PhoneNumCheck
{
	int Check(String s)
	{
		if(s.length()>17||s.length()<13||s.length()==16) return 1;
		if('+'==s.charAt(0)) s=s.substring(1);	
		for(int i=0;i<s.length();i++)
		{
			if((s.charAt(i)>'9'||s.charAt(i)<'0')&&s.charAt(i)!='-') return 2;
			else continue;
		}
		if(s.charAt(0)!='8'||s.charAt(1)!='6') return 3;
        if(s.length()!=16&&s.length()!=14&&s.length()!=13) return 4;
		if(s.length()==16&&(s.charAt(2)!='-'||s.charAt(6)!='-'||s.charAt(11)!='-')) return 4;
		if(s.length()==14 && s.charAt(2)!='-') return 4;
		String t="1";
		String str[]=s.split("-");
		for(int i=0;i<str.length;i++)
			t+=str[i];
		t=t.substring(1);
		if(t.length()!=13) return 2;
		return 0;	
	} 
	public static void main(String args[])throws IOException
	{
		PhoneNumCheck chk=new PhoneNumCheck();
		String s ;
		while(true)
		{
		System.out.println("Please Input A Phone Number: ");
		BufferedReader buf = new BufferedReader (new InputStreamReader(System.in));
		s = buf.readLine();
		
		if(s.equalsIgnoreCase("exit")) return;
		System.out.println(chk.Check(s));
	  }	
	}
}